package com.bua.control;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.DialogInterface.OnMultiChoiceClickListener;

public class MultipleAlert  {

	private AlertDialog multipleAlert=null;
	private Context mContext=null;
	private MultipleCheckButton refButton=null;
	

	public  MultipleAlert(Context context, MultipleCheckButton sender) {
		mContext=context;
		refButton=sender;
		multipleAlert=new AlertDialog.Builder(mContext).setMultiChoiceItems(sender.items, sender.checked, new OnMultiChoiceClickListener() {
			
			@Override
			public void onClick(DialogInterface dialog, int which, boolean isChecked) {
				// TODO Auto-generated method stub
				refButton.checked[which]=isChecked;
			}
		}).setTitle("请选择").setNegativeButton("确定", new OnClickListener() {
			
			@Override
			public void onClick(DialogInterface dialog, int which) {
				// TODO Auto-generated method stub
				refButton.UpdateTitle();
			}
		}).create();
		// TODO Auto-generated constructor stub
	}
	
	public void Show()
	{
		multipleAlert.show();
	}

	

}
